package com.yc.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 房子表
 * @TableName house
 */
@TableName(value ="house")
@Data
public class HouseDTO implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String province;
    private String city;
    private String region;
    /**
     * 房屋详细地址
     */
    @NotBlank(message = "房屋详细地址不能为空")
    @TableField(value = "address")
    private String address;

    /**
     * 房客编号(0表示暂无房客，可表示房屋状态)
     */
    @TableField(value = "guest_id")
    private Integer guestId;

    /**
     * 房东编号
     */
    @TableField(value = "master_id")
    private Integer masterId;

    @NotBlank(message = "房屋面积不能为空")
    @TableField(value = "area")
    private String area;

    /**
     * 租房方式（整租/合租）
     */
    private String type;
    /**
     * 房子价格(元/月)
     */
    @NotNull(message = "房子价格不能为空")
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 房子规模(一室一厅，两室一厅...)
     */
    @NotBlank(message = "房子规模不能为空")
    @TableField(value = "scale")
    private String scale;

    /**
     * 房子内部及周边介绍
     */
    @NotBlank(message = "房屋标题不能为空")
    @Length(min = 5,max = 20,message = "内容长度5-20")
    @TableField(value = "introduce")
    private String introduce;

    //经纬度
    private Double lng;
    private Double lat;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private List<String> imgUrls;

    //周围房源
    @TableField(exist = false)
    private List<House> nearbyHouseList;
}